//
// Created by Administrator on 2018/7/1 0001.
//

#ifndef SUPERAUDIOPLAYER_WIQUEUE_H
#define SUPERAUDIOPLAYER_WIQUEUE_H

#include <queue>
#include <pthread.h>
#include <ffmpeg.h>
#include "androidLog.h"
#include "WIPlayState.h"
#include "include/ffmpeg.h"

using namespace std;

class WIQueue {
public:
    //avpacket队列
    queue<AVPacket *> queuepacket;
    //线程锁
    pthread_mutex_t mutexpacket;
    //消息
    pthread_cond_t condpacket;
    //播放状态
    WIPlayState *playState = NULL;


public:
    WIQueue(WIPlayState *playState);

    ~WIQueue();

    int putAvPacket(AVPacket *avPacket);

    int getAvPacket(AVPacket *avPacket);

    int getQueueSize();

    void clearPackets();

};


#endif //SUPERAUDIOPLAYER_WIQUEUE_H
